<main>
  <section>
    <div>
      <mat-card>
        <mat-card-header>
          <mat-card-title>登录认证</mat-card-title>
          <mat-card-subtitle>登录认证</mat-card-subtitle>
        </mat-card-header>
        <mat-card-content (keydown)=keydownHandle($event)>
          <div class="loader"
               *ngIf="isLoging">

            <mat-spinner></mat-spinner>
          </div>
          <div class="login-form">
            <mat-form-field class="username-field">
              <input matInput
                     type="text"
                     placeholder="登录名"
                     [(ngModel)]="username">
            </mat-form-field>
            <mat-form-field class="password-field">
              <input matInput
                     type="password"
                     placeholder="密码"
                     [(ngModel)]="password">
            </mat-form-field>
          </div>
        </mat-card-content>
        <mat-card-actions>
          <button mat-button
                  (click)="doLogin()"
                  color="primary">
            登录
          </button>
          <button mat-button>忘记密码</button>
        </mat-card-actions>
      </mat-card>
    </div>
  </section>
</main>
